<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>业务申请查询页面</title>
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/easyui_my.css">
<link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="${ctx}/css/css.css" />
<script type="text/javascript" src="${ctx}/js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="${ctx}/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx }/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/js/common.js"></script>
<script type="text/javascript" src="${ctx}/js/placehold.js"></script>
<script type="text/javascript">
$(function(){
    //设置日期初始值
 	$("#startTime").datetimebox("setValue",getDatex(7));
 	$("#endTime").datetimebox("setValue",getDatex1(-1));
    initTable(1,20,1);
    $('#ztSelect').combobox({
    	onChange: function (val,o) {
    		debugger;
    	    initTable(1,20,val);
    	}
    });
    $('#ztSelect').combobox('select','1');
    ClickXzqhFun();
});

//数据表
function initTable(pageNumber,pageSize,bussinessType){
    debugger;
	var param={
		pageSize:pageSize,
        page:pageNumber,
        startTime:$("#startTime").combobox('getValue'),
        endTime:$("#endTime").combobox('getValue'),
        bussinessType:bussinessType
	}
	
	var url='${ctx}/audit/queryAuditByPage.htm';
	var column=[[
		{field:'lsh',title:'流水号',width:'100',fixed:true,align:'center',split:true},
		{field:'hphm',title:'号牌号码',width:'100',fixed:true,align:'center',split:true},
		{field:'ywlx',title:'业务类型',width:'100',fixed:true,align:'center',split:true},
        {field:'applicant',title:'申请人',width:'200',fixed:true,align:'center',split:true},
        {field:'strApplyDate',title:'申请时间',width:'200',fixed:true,align:'center',split:true},
        {field:'applicantBmmc',title:'申请人所在部门',width:'300',fixed:true,align:'center',split:true},
        {field:'strPermission',title:'权限类型',width:'100',fixed:true,align:'center',split:true},
        {field:'strZt',title:'状态',width:'150',fixed:true,align:'center',split:true},
        {field:'cz',title:'操作',width:'300',align:'center',fixed:true,split:true,formatter:function(value,row,index){
        	return "<a href='javascript:void(0)' applyNo='"+row.applyNo+"' name='viewDetail' class=\"chense\" >详情</a>";
        }}
      ]];
	  loadTable('TableData',url,param,column);
} 

function loadSuccess(){
	debugger;
	//审核事件
	$('a[name=audit]').unbind('click').bind('click',function(){
		var $this=$(this);
		var applyNo=$this.attr('applyNo');//申请编号
		var zt=$this.attr('zt');//状态
		var message=$this.text();
		if(confirm('确认执行'+message+'操作?')){
			$.ajax({
	            type:'post',
	            url:'${ctx}/audit/auditApply.htm',
	            data:{
	               applyNo:applyNo,
	               zt:zt
	            },
	            success:function(data){
	                debugger;
	                if(data=='01'){
	                	alert('审核成功');
	                	queryDataGrid();//重新加载页面
	                }
	              
	            }
	       });
		}else{
			return false;
		}
	});
	$('a[name=viewDetail]').unbind('click').bind('click',function(){
		debugger;
		var applyNo=$(this).attr('applyNo');
		showDetail(applyNo);
	});
}

//此处点击事件不要了
function CheckInfo(xh){
	
} 

//根据界面中的样件，过滤查询机动车基本信息列表
function queryDataGrid(){
	debugger;
	var startTime = $("#startTime").combobox('getValue');
	var endTime = $("#endTime").combobox('getValue');
	  $("#TableData").datagrid("load",{
	      startTime:startTime,
	      endTime:endTime
	  });
}
</script>
</head>
<body class="easyui-layout" options="border:false">
<div data-options="region:'north',height:63,border:false" style="padding-left:10px;padding-right: 10px;padding-top: 5px;">
  <div class="xinxichaxunkuangz1">
    <div class="dashujtiaojianxuanxiangkuan">
      <div class="dashujtiaojianxuanxiangkuan_lie">
          <div class="tiaojian_key">开始时间：</div>
          <div class="tiaojian_values">
            <ul class="tiaojian_values_limian">
              <li>
                <input id="startTime" type="text" name="startTime" class="easyui-datetimebox shurukuangkais"/>
              </li>
              <li><span class="buchongdbiaotdsw">结束时间：</span>
                <input id="endTime" type="text" name="endTime" class="easyui-datetimebox shurukuangkais"/>
              </li>
            </ul>
          </div>
        </div>
      </div>
      <div class="chaxunchongzhianniu">
        <a href="javascript:queryDataGrid()" class="sousuocx">查询</a>
        <a href="javascript:applyForAuth()" class="sousuocx">权限申请</a>
      </div>
    </div>
    </div>
<div data-options="region:'center',border:false" style="padding-left:10px;padding-right: 10px">
  <div class="easyui-layout xinxichaxunkuangz2" data-options="fit:true,border:false">
    <div class="tupianqiehuantop" data-options="region:'north',border:false" style="height: 37px">
      <span class="chaxunjieguosd">搜索结果</span>
    </div>
    <div id="tableDiv" data-options="region:'center',border:false" style="overflow-y: auto;">
      <table id="TableData" data-options="cls:'biaogeycangds',fit:true"></table>
    </div>
    <div data-options="region:'south',border:false" style="height:32px">
      <div class="easyui-panel">
        <div class="easyui-pagination" id="pp"></div>
      </div>
     </div>
     <jsp:include page="/WEB-INF/content/yxsh/addApplyr.jsp" />
<%--      <jsp:include page="/WEB-INF/content/yxsh/addApplyDriver.jsp" />
 --%>     <jsp:include page="/WEB-INF/content/yxsh/qxDetail.jsp" />
  </div>
</div>
<script type="text/javascript">
    function applyForAuth(){
    	debugger;
    	var ztSelect=$('input[name=ztSelect]').val();
    	$('#SaveOrUpdateDevWin').window('open');
        clearInfo();
        $('#dd').hide();
    }
   
    //清空申请页面信息(机动车)
    function clearInfo(){
    	$("#vehicleList").html("");
    }
</script>
</body>
</html>
